/**
 * Created by lenovo on 2017/12/18.
 */
define(['ngApp', 'ngHttp', 'jquery', 'ngConstant', 'ngAlert'], function (ngApp, ngHttp, JQ, ngConstant, ngAlert) {
    ngApp.controller("leftTab", function ($scope, $http, $timeout, $rootScope, $state, $uibModal, commonFn, $cookies,$window) {
        $('.tabBox').height($rootScope.leftTabHeight);
        $('.tab_ul .leftBg').click(function(){
            $('.tab_ul .leftBg').removeClass('active');
            $(this).addClass('active');
        });

        if ( window.location.hash == '#!/leftTab1') {
            $('.leftBg1').addClass('active');
        } else if (window.location.hash == '#!/leftTab2'){
            $('.leftBg2').addClass('active');
        } else if (window.location.hash == '#!/leftTab3'){
            $('.leftBg3').addClass('active');
        } else if (window.location.hash == '#!/leftTab4'){
            $('.leftBg4').addClass('active');
        } else if (window.location.hash == '#!/leftTab5'){
            $('.leftBg5').addClass('active');
        } else if (window.location.hash == '#!/leftTab6'){
            $('.leftBg6').addClass('active');
        } else if (window.location.hash == '#!/leftTab7'){
            $('.leftBg7').addClass('active');
        } else if (window.location.hash == '#!/leftTab8'){
            $('.leftBg8').addClass('active');
        } else if ( window.location.hash == '#!/leftTab6_1') {
            $('.tab_ul .leftBg6').addClass('active');
        } else if ( window.location.hash == '#!/leftTab9') {
            $('.tab_ul .leftBg9').addClass('active');
        }

        $('.dropDownMenu p.title').click(function(){
            $(this).siblings('.panes').slideToggle(500);
            console.log($(this).find('.fr'));
            $(this).find('.fr').toggleClass('rotate');
        });

        $http({
            url: ngConstant.interfaceHost + 'manager/msg/findUnreadCount',
            method: 'GET',
            headers: {'Authorization':$cookies.get("token")}
        }).then(function(res){
            $rootScope.msgNum = res.data.data;

        });


    })
});